package com.my.code.testcode.买票卖票;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * 描述:
 * 主程序
 *
 * @author 54485
 * @create 2018-09-17 9:03
 */
public class SellMain {


    public static void main(String[] args) {

        Lock lock = new ReentrantLock();
        Condition condition = lock.newCondition();
        SellShop sellShop = new SellShop(lock,condition);

        Thread thread = new Thread(sellShop,"商店1");
        Thread thread2 = new Thread(sellShop,"商店2");
        Thread thread3 = new Thread(sellShop,"商店3");

        thread.start();
        thread2.start();
        thread3.start();

        System.out.println("OVER！！！");
    }
}
